package per.jdz.retryer.predicate;

import java.util.Arrays;
import java.util.function.Predicate;

public class Predicates<T> {
    
    public static Predicate throwTo(Class<? extends Throwable> throwable) {
        return new ThrowsPredicate(throwable);
    }

    public static Predicate equalTo(Object object) {
        return new IsEqualPredicates<>(object);
    }

    public static Predicate or(Predicate...predicates) {
        if (null == predicates || 0 == predicates.length) {
            return null;
        }
        return new OrPredicate(Arrays.asList(predicates));
    }
}
